home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / cc / sprite / RCS / varargs.h,v < prev    next >
Encoding:
Text File  |  1989-09-26  |  1.1 KB  |  73 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     89.07.18.09.19.57;  author rab;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     89.07.18.09.19.05;  author rab;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @*** empty log message ***
  27. @
  28. text
  29. @#ifdef TARGET_SPUR
  30. #include "va-spur.h"
  31. #else
  32.  
  33. /* These macros implement traditional (non-ANSI) varargs
  34.    for GNU C.  */
  35.  
  36. #define va_alist  __builtin_va_alist
  37. #define va_dcl    int __builtin_va_alist;
  38. #define va_list   char *
  39.  
  40. #ifdef TARGET_SUN4
  41. #define va_start(AP)                         \
  42.  (__builtin_saveregs (),                    \
  43.   AP = ((void *) &__builtin_va_alist))
  44. #else
  45. #define va_start(AP)  AP=(char *) &__builtin_va_alist
  46. #endif
  47. #define va_end(AP)
  48.  
  49. #define __va_rounded_size(TYPE)  \
  50.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  51.  
  52. #define va_arg(AP, TYPE)                        \
  53.  (AP += __va_rounded_size (TYPE),                    \
  54.   *((TYPE *) (AP - __va_rounded_size (TYPE))))
  55.  
  56. #endif /* not spur */
  57. @
  58.  
  59.  
  60. 1.1
  61. log
  62. @Initial revision
  63. @
  64. text
  65. @a0 4
  66. #ifndef __GNUC__
  67. /* Use the system's macros with the system's compiler.  */
  68. #include "/usr/include/varargs.h"
  69. #else
  70. a28 1
  71. #endif /* __GNUC__ */
  72. @
  73.